home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_pru_torchlight.cog < prev    next >
Text File  |  1999-11-15  |  3KB  |  94 lines

  1. # Jones 3D Cog Script
  2. #
  3. # PRU_torchlight.cog
  4. #    An alternative to gen_torchlight if hardcoded values are preferable.
  5. #    Indy reach animation plays dependent on value of reach. Flame is present but invisible at startup 
  6. #
  7. # [SXC] [RKD] [GGJ]
  8. #
  9. # (C) 1998 LucasArts Entertainment Company LLC. All Rights Reserved
  10. #
  11. # ========================================================================================
  12. symbols
  13.  
  14. message     activated
  15. message     startup
  16.  
  17. thing       torch                //the thing you light
  18. thing       flame    nolink        //flame, hidden at startup
  19. thing        dynalite            //dynamic light (to control where light is cast)
  20. thing        otherthing            //item that gets highlighted
  21. thing        player        local
  22.  
  23. keyframe    liteMed=in_light_stuff.key            local
  24. keyframe    liteHi=in_light_stuff_high.key        local
  25.  
  26. sound       burning=gen_torch_burnin_c.wav  local
  27. sound        fwoosh=gen_torchlitet_c.wav        local
  28. sector        litSector
  29.  
  30. vector      minlite        local
  31. vector      maxlite        local
  32.  
  33. flex        minradius=0.3    local
  34. flex        maxradius=0.3    local
  35. flex        dynaradius=0.6
  36.             
  37. flex        reach=0                        //0 for medium, 1 for high
  38. flex        islit=0            local        //set to 1 if torch lights at startup
  39. flex        flicker=1                    //set to 0 to eliminate flicker
  40. end
  41.  
  42. # ========================================================================================
  43. code
  44.  
  45. startup:
  46.     player = GetLocalPlayerThing();
  47.     minlite = VectorSet(0.75, 0.60, 0.16);
  48.     maxlite = VectorSet(0.70, 0.65, 0.45);    
  49.     SetThingFlags(flame, 0x10);
  50.     SetThingLight(torch, VectorSet(0.0, 0.0, 0.0), 0.3, 0.1);
  51.     return;
  52. # ........................................................................................
  53. activated:
  54.     if (islit) return;
  55.     if ((GetCurWeapon(player) != 13) && (!InEditor())) return;
  56.     islit = 1;
  57.     
  58.     StartCutscene(1);    
  59.     StopThing(player);
  60.     SetActorFlags(player, 0x200000);
  61.     if (reach == 0)
  62.     {
  63.         PlayKey(player, liteMed, 4, 0x12, 1);
  64.     }
  65.     else if (reach == 1)
  66.     {
  67.         PlayKey(player, litehi, 4, 0x12, 1);
  68.     }
  69.     ClearActorFlags(player, 0x200000);
  70.     EndCutscene();
  71.  
  72.     ClearThingFlags(flame, 0x10);
  73.     PlaySoundThing(fwoosh, torch, 0.4, 3, 10, 0);
  74.     SetThingLight(torch, minlite, 0.3, 0.5);                           
  75.     if (litSector)
  76.     {
  77.         SetSectorLight(litSector, '0.1 0.3 0.5', 2.0);
  78.     }
  79.     if (dynalite)
  80.     {
  81.         SetThingLight(dynalite, maxlite, dynaradius, 0.5);
  82.     }
  83.     if (otherthing)
  84.     {
  85.         Print("lighting other thing");
  86.         SetThingLight(otherthing, maxlite, 0.01, 0.5);
  87.     }
  88.     PlaySoundThing(burning, torch, 1, 5, 7, 1);
  89.     
  90.     if (flicker == 0) return;
  91.     ThingLightAnim(torch, minlite, minradius, maxlite, maxradius, 2);
  92.     return;
  93. end
  94.